using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICChangeEntryMap : EntityTypeConfiguration<ICChangeEntry>
    {
        public ICChangeEntryMap()
        {
            // Primary Key
            this.HasKey(t => t.FEntryID);

            // Properties
            this.Property(t => t.FMtrlType)
                .HasMaxLength(255);

            this.Property(t => t.FBatchNo)
                .HasMaxLength(255);

            this.Property(t => t.FBIllNo_SRC)
                .IsRequired()
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("ICChangeEntry");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FIndex).HasColumnName("FIndex");
            this.Property(t => t.FMtrlType).HasColumnName("FMtrlType");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FBaseQty).HasColumnName("FBaseQty");
            this.Property(t => t.FAuxQty_Base).HasColumnName("FAuxQty_Base");
            this.Property(t => t.FSecUnitID).HasColumnName("FSecUnitID");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FSecCoefficient).HasColumnName("FSecCoefficient");
            this.Property(t => t.FQty_Base).HasColumnName("FQty_Base");
            this.Property(t => t.FKFDate).HasColumnName("FKFDate");
            this.Property(t => t.FKFPeriod).HasColumnName("FKFPeriod");
            this.Property(t => t.FPeriodDate).HasColumnName("FPeriodDate");
            this.Property(t => t.FBatchNo).HasColumnName("FBatchNo");
            this.Property(t => t.FStockID).HasColumnName("FStockID");
            this.Property(t => t.FSPID).HasColumnName("FSPID");
            this.Property(t => t.FClassID_SRC).HasColumnName("FClassID_SRC");
            this.Property(t => t.FBIllNo_SRC).HasColumnName("FBIllNo_SRC");
            this.Property(t => t.FEntryID_SRC).HasColumnName("FEntryID_SRC");
            this.Property(t => t.FID_SRC).HasColumnName("FID_SRC");
        }
    }
}
